var plugin = requirePlugin("myPlugin");

let br ={
          name: "测试权益",
          startTime: '1611655553000',
          endTime: '1611914753000',
          appId: '3000000029240212',
          appUrl:'https://market.m.taobao.com/app/miniapp-biz/qrcode/index.html?_ariver_appid=3000000029240212',
          targetEntityList: [],
          myCallBack(res){console.info(res)},
          myCallBackWithSetData:null, // 使用进行setData的callback
          myBackCallback(){},
          myBackCallbackWithSetData:null,  // 注意this的指向(绑定this)
        }

Page({

  data: {
    name: "测试权益",
    startTime: '1611655553000',
    endTime: '1611914753000',
    appId: '3000000029240212',
    appUrl:'https://market.m.taobao.com/app/miniapp-biz/qrcode/index.html?_ariver_appid=3000000029240212',

    targetEntityList: ['626713308430'],

    myCallBack(res){console.info(res)},
    myCallBackWithSetData:null, // 使用进行setData的callback
    myBackCallback(){},
    myBackCallbackWithSetData:null,  // 注意this的指向(绑定this)
  },
  
  cb() {
    this.setData({ color: "setdata" })
  },

  backCb() {
    this.setData({ color: "setdata" })
  },

  navigateToPlugin() {//打开权益管理中心
    my.navigateTo({ url: 'plugin://myPlugin/orightindex-page' });
  },

  onLoad() {

    my.authorize({
      scopes: '*',
      success: (res) => {
        my.alert({
          content: res,
        });
      },
    });

    this.cb = this.cb.bind(this);

    this.backCb = this.backCb.bind(this);

    this.setData({
      myCallBackWithSetData: this.cb.bind(this),
      myBackCallbackWithSetData: this.backCb.bind(this),
    })

    my.alert({content:JSON.stringify(this.data)})

    //plugin.setBridge(this.data.br); 
    
  },
});
